package com.desire.homework;

import java.util.Scanner;

/**
 * 计算两个数据
 *
 * @author desire
 */
public class _01_计算两数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数:");
        double s1 = sc.nextDouble();
        System.out.println("请输入第二个数:");
        double s2 = sc.nextDouble();
        System.out.println("请输入运算符号:");
        switch (sc.nextLine()) {
            case "+":
                System.out.println(s1 + "+" + s2 + "=" + (s1 + s2));
                break;
            case "-":
                System.out.println(s1 + "-" + s2 + "=" + (s1 - s2));
                break;
            case "*":
                System.out.println(s1 + "*" + s2 + "=" + (s1 * s2));
                break;
            case "/":
                System.out.println(s1 + "÷" + s2 + "=" + (s1 / s2));
                break;
            default:
                double sum = s1 + s2;
                System.out.println(sum);
        }
    }
}
